From 4f303f9f216907f6fc17ca6a7f330a56f86c0614 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 20 Jul 2009 01:38:38 +0000 Subject: [PATCH] Sketch in a functional, cross-platofrm help. --- gui/help.cpp | 35 ++++++++++++----------------------- gui/help.h | 3 +-- gui/help/gpsbabel.html | 3 +++ 3 files changed, 16 insertions(+), 25 deletions(-) create mode 100644 gui/help/gpsbabel.html diff --git a/gui/help.cpp b/gui/help.cpp index d424f088b..c8ae3b264 100644 --- a/gui/help.cpp +++ b/gui/help.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: help.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: help.cpp,v 1.2 2009/07/20 01:38:38 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -22,31 +22,20 @@ //------------------------------------------------------------------------ #include "help.h" #include -#include -#include - - -//------------------------------------------------------------------------ -#ifndef _WIN32 -void ShowUrl(const QString &url) -{ - QString progName = QApplication::applicationDirPath() + "/showUrl.sh"; - QStringList args; - args << url; - QProcess::startDetached(progName, args); -} -#else -#include -void ShowUrl(const QString &url) -{ - ShellExecuteA(0, "open", url.toStdString().c_str(), 0, 0, SW_SHOWNORMAL); -} -#endif +// #include +// #include +#include +#include //------------------------------------------------------------------------ void ShowHelp(const char *name) { - QString urlname = "file://" + QApplication::applicationDirPath() + "/help/" + name; - ShowUrl(urlname); + QUrl urlname("file://" + QApplication::applicationDirPath() + + "/help/" + name); + // FIXME(robertl): This shoud probably parent from QApplication::mainWidget(); + QWebView *view = new QWebView(); + view->setWindowTitle("GPSBabel Help"); + view->load(urlname); + view->show(); } diff --git a/gui/help.h b/gui/help.h index 838747e42..7c8da1450 100644 --- a/gui/help.h +++ b/gui/help.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: help.h,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: help.h,v 1.2 2009/07/20 01:38:40 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -23,7 +23,6 @@ #ifndef HELP_H #define HELP_H #include -extern void ShowUrl(const QString &url); extern void ShowHelp(const char *name); #endif diff --git a/gui/help/gpsbabel.html b/gui/help/gpsbabel.html new file mode 100644 index 000000000..fd07cbc0f --- /dev/null +++ b/gui/help/gpsbabel.html @@ -0,0 +1,3 @@ +

This is the local help. It currently isn't very helpful.

+

The online help + is mo betta.

-- 2.30.2